<script type="text/javascript">
    $(document).ready(function(){
        $("#addForm").validate({
            rules: {
                username: {
                    required: true
                },
                password: {
                    required: true
                } 
            },
            messages: {
                username: {
                    required: "Không được để trống"
                },
                password: {
                    required: "Không được để trống"
                } 
            }
        });
    });

</script>

<form action="index.php" method="post" id="addForm" onsubmit="return check()">
    <fieldset>
        <legend>Đăng nhập</legend>
        <table>
            <tr>
                <td>Username: </td>
                <td><input type="text" name="username" size="30" placeholder="..tên tài khoản" /></td>
            </tr>
            <tr>
                <td>Password: </td>
                <td><input type="password" name="password" size="30" placeholder="..mật khẩu" /></td>
            </tr>
            <tr>
                <td><img style="width: 100px; height: 25px" src="library/captcha.php" /></td>
                <td><input name="number" type="text" id="number" /></td>
            </tr>
            <tr>
                <td></td>
                <td><p class="error"><?php echo $notice; ?></p></td>
            </tr>
            <tr>
                <td><input type="hidden" name="task" value="login" /></td>
                <td><input type="submit" name="submit" value="Đăng nhập" /></td>
            </tr>
        </table>    
    </fieldset> 
</form>